// types.ts
import { StyleProp, ViewStyle, TextStyle } from 'react-native';

export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading' | '';
export type ToastPosition = 'top' | 'center' | 'bottom';

export interface ToastOptions {
    message: string;
    type?: ToastType;
    duration?: number;
    position?: ToastPosition;
    onClose?: () => void;
    icon?: React.ReactElement | null;
    style?: StyleProp<ViewStyle>;
    textStyle?: StyleProp<TextStyle>;
    showMask?: boolean;
}

export interface ToastInstance {
    show: (options: ToastOptions) => string;
    hide: (id: string) => void;
    hideAll: () => void;
    success: (message: string, options?: Omit<ToastOptions, 'message' | 'type'>) => string;
    error: (message: string, options?: Omit<ToastOptions, 'message' | 'type'>) => string;
    warning: (message: string, options?: Omit<ToastOptions, 'message' | 'type'>) => string;
    info: (message: string, options?: Omit<ToastOptions, 'message' | 'type'>) => string;
    loading: (message: string, options?: Omit<ToastOptions, 'message' | 'type'>) => string;
}